import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:vischat/generated/icons/app_icons.dart';
import 'package:vischat/modules/home/posts/widgets/posts_button.dart';

/// 动态卡片占位组件（骨架屏）
class PostsCardShimmer extends StatelessWidget {
  const PostsCardShimmer({super.key});

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(horizontal: 60.w, vertical: 10.h),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            margin: EdgeInsets.symmetric(vertical: 10.w),
            child: Row(
              children: [
                CircleAvatar(radius: 48.r),
                Expanded(
                  child: Container(
                    margin: EdgeInsets.symmetric(horizontal: 20.w),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(
                          '▆▆▆▆▆▆▆▆▆▆',
                          style: TextStyle(
                            fontSize: 28.sp,
                            fontWeight: FontWeight.w900,
                          ),
                        ),
                        Text(
                          '▆▆▆▆▆',
                          style: TextStyle(
                            fontSize: 28.sp,
                            fontWeight: FontWeight.w900,
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
                Container(
                  width: 160.w,
                  height: 60.w,
                  decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(12.r),
                  ),
                ),
              ],
            ),
          ),
          Container(
            margin: EdgeInsets.symmetric(vertical: 10.h),
            child: Text(
              '▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆',
              maxLines: 3,
              style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w900),
            ),
          ),
          Container(
            margin: EdgeInsets.symmetric(vertical: 10.h),
            child: SizedBox(
              width: double.infinity,
              child: AspectRatio(
                aspectRatio: 9 / 4,
                child: Container(
                  decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(10.r),
                  ),
                ),
              ),
            ),
          ),
          Container(
            margin: EdgeInsets.symmetric(vertical: 10.h),
            child: Text(
              '▆▆▆▆▆▆',
              style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w900),
            ),
          ),
          Container(
            margin: EdgeInsets.symmetric(vertical: 10.h),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                PostsButton(icon: AppIcons.like, text: '▆▆'),
                PostsButton(icon: AppIcons.comment, text: '▆▆'),
                PostsButton(icon: AppIcons.share, text: '▆▆'),
                PostsButton(icon: AppIcons.collection, text: '▆▆'),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
